home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
jaz_clib.arc
/
JZPRSFIL.C
< prev
next >
Wrap
Text File
|
1989-04-09
|
1KB
|
40 lines
/*
┌────────────────────────────────────────────────────────────────────────────┐
│jzprsfil.c │
│Parse out the file name and the path from a full path spec. │
│Note that the path WILL contain a "\" after it ! │
│Synopsis: │
│ *fullpath = "\\MSC\\JAZ\\SOURCE"; │
│ jzprsfil(fullpath,wpath,wfile); │
│ printf("%s %s",wpath,wfile); { will output } │
│ { \MSC\JAZ\ SOURCE } │
│ │
└────────────────────────────────────────────────────────────────────────────┘
*/
jzprsfil(ffull,fpath,fsource)
char *ffull,
*fpath,
*fsource;
{
int w;
w = strlen(ffull) - 1;
while ((w >= 0) && ((*(ffull+w) != ':') && (*(ffull+w) != '\\')))
w --;
if (w == -1) {
*fpath = 0; /* return null path */
strcpy(fsource,ffull); /* copy full path to source */
}
else {
strncpy(fpath,ffull,++w);
*(fpath+w) = 0; /* terminate the string */
while (*fsource++ = *(ffull+w++))
;
}
}